/*
 * @Author: Starfish_DL
 * @Date: 2020-09-27 10:53:44
 * @LastEditors: Starfish_DL
 * @LastEditTime: 2020-09-27 11:45:38
 * @CurrentVersion: 1.0
 * @Description: 
 */
#include<iostream>
using namespace std;
#define MAXSIZE 50

class IntSqStack
{
public:
    int data[MAXSIZE];
    int top;
    IntSqStack();
    void Push(IntSqStack *s,int e);
    int Pop(IntSqStack *s);
    int GetTop(IntSqStack *s);
    ~IntSqStack();
};

IntSqStack::IntSqStack()
{
    for (int i = 0; i < MAXSIZE; i++)
    {
        data[i]=0;
    }
    top=-1;
}

IntSqStack::~IntSqStack()
{
}

void IntSqStack::Push(IntSqStack *s,int e)
{
    if (s->top==MAXSIZE-1)
    {
        return;
    }
    s->top++;
    s->data[s->top]=e;
    return;
}

int IntSqStack::Pop(IntSqStack *s)
{
    if (s->top==-1)
    {
        return null;
    }
    s->top--;
    return s->data[s->top+1];
}

int IntSqStack::GetTop(IntSqStack *s)
{
    if (s->top==-1)
    {
        return null;
    }
    return (s->data[s->top]);
}

//note 这里涉及到了一道例题，判断对称串；由于出栈的顺序正好与字符串的顺序相反，因此可以用来进行比较，从而判断成功。 
